package com.authine.cloudpivot.ext.dto.kingDee.request;

import com.authine.cloudpivot.ext.constants.PlatformConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "K3-收货")
public class KingDeeReturnGeneration {

    @Schema(description = "refund")
    private KingDeeOrderGoodsRefund refund;

    /**
     * 退货有选择退平台还是供应商，这个代表是否退平台
     */
    @Schema(description = "pm")
    private Boolean Pm;
    /**
     * 账套名
     */
    @Schema(description = "账套名")
    private String accountName;

    public String getAccountName() {
        return StringUtils.isBlank(accountName)?accountName: PlatformConst.PLATFORM_ORGANIZATIONS.get("2").equals(accountName)?"2":"1";
    }
}
